import { View, Text, Button, Input, Image, Radio } from '@tarojs/components'

import './login.scss'

import bg_img from '@/static/images/auth/bg.png'
import au_pp from '@/static/images/auth/pp.png'
import more_img from '@/static/images/auth/more.png'
import Taro from '@tarojs/taro'

import  { useState } from 'react';



definePageConfig({

  navigationStyle: 'custom',

})

export default function Login() {

  const [mobile, setMobile] = useState('')
  //   handleSomething() {
  //     console.log(this.state.mobile);
  // }
  const navPrivacy = (flag) => {
    Taro.navigateTo({
      url: `/login/privacy/privacy${flag === 1 ? 'User' : ''}`,
    })
  }
  const getMsCode = () => {
    
    Taro.navigateTo({
      url: `/login/login/verifyCode?mobile=${mobile}`,
    })
  }
  const mePro = () => {
    Taro.navigateTo({
      url: '/login/privacy/issues',
    })
  }
 const onInput = (e) => {
    setMobile(e.target.value)
  }

  return (
    <View className='login'>
      <Image
        className='bg-image'
        mode='widthFix'
        src={bg_img}
      />
      <View className='box'>
        <View className='title'>欢迎登录超维娱网</View>
        <View className='phoneNumber'>
          <View className='nm'>+86<Image src={more_img} mode='widthFix' className='icon_global'></Image></View>
          <Input type='number' placeholder='请输入手机号码' value={mobile} onInput={onInput} />
        </View>
        <View className='line'></View>
        <View className='tips'>未注册的手机号验证后自动创建账号</View>
        <Button className='getMsCode global_button' onClick={getMsCode}>获取短信验证码</Button>
        <View className='mP' onClick={mePro} ><Text>遇见问题&nbsp;</Text><Image src={au_pp} mode='widthFix' className='icon_global'></Image></View>
      </View>
      <View className='agger'><Radio className='radio' color='#333333' style={{color:'#333333',width:'26rpx',height:'26rpx',marginRight:'24rpx'}}></Radio><View >我已阅读并同意<Text className='org' onClick={() => navPrivacy(0)} >《用户协议》</Text>和<Text className='org' onClick={() => navPrivacy(1)}>《隐私政策》</Text> </View></View>
    </View>
  )


}
